//
//  Student.m
//  OC02实例变量可见度_方法
//
//  Created by dllo on 16/2/25.
//  Copyright © 2016年 APON. All rights reserved.
//

#import "Student.h"

@implementation Student
#pragma 重写 init
- (instancetype)init
{
    self = [super init];
    if (self) {
        _classroomName = @ "dls160101";
    }
    return self;
}
#pragma mark 重写父类方法
/**
 *重写父类方法时,父类不用再. h 文件中声明,直接在.m 文件中实现即可
 *
 */
- (void)sayHi
{
    /**
     *super 是编译器 指令,指调用父类方法
     *[super sayHi]是当前对象调用父类的方法,而不是父类对象调用 sayHi 的方法
     */
    [super sayHi];
    NSLog(@"grade:%f, clssroomName:%@,", _grade, _classroomName);
}







- (void)setGrade:(float)grade
{
    _grade = grade;
}
- (float)grade
{
    return _grade;
}
- (void)setClassroomName:(NSString *)classroomName
{
    _classroomName = classroomName;
}
- (NSString *)classroomName
{
    return _classroomName;
}

@end
